<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<ui:composition template="template.xhtml">
	<ui:define name="content">
	
	<br />
	<h:form>
	<p:fieldset legend="Riepilogo">
		<h2><h:outputText value="#{personalizationBean.pack.name}" /></h2>
		
		<table cellpadding="10px">
			<tr>
				<td>Pacchetto viaggio:</td>
				<td>#{personalizationBean.reservation.package.name}</td>
				<td></td>
			</tr>
			<tr>
				<td>Località:</td>
				<td>#{personalizationBean.reservation.package.location.name}</td>
				<td></td>
			</tr>
			<tr>
				<td>Numero di persone:</td>
				<td>#{personalizationBean.reservation.peopleNumber} persone</td>
				<td></td>
			</tr>
			<tr>
				<td>Soggiorno in hotel:</td>
				<td>
					#{personalizationBean.reservation.hotelAvailability.hotelName}<br/>
					Tipologia camera: #{personalizationBean.reservation.hotelAvailability.room.name}, predisposta per #{personalizationBean.reservation.hotelAvailability.room.beds} persone<br />
					Periodo: dal 
					<h:outputText value="#{personalizationBean.reservation.hotelAvailability.fromDate}" >
						<f:convertDateTime pattern="dd.MM.yyyy" />
					</h:outputText> al 
					<h:outputText value="#{personalizationBean.reservation.hotelAvailability.toDate}" >
						<f:convertDateTime pattern="dd.MM.yyyy" />
					</h:outputText>
					Costo per notte: #{personalizationBean.reservation.hotelAvailability.price} euro
				</td>
				<td>#{personalizationBean.reservation.hotelPrice} euro</td>
			</tr>
			<tr>
				<td>Escursione:</td>
				<td>
					#{personalizationBean.reservation.excursionAvailability.excursionName}<br/>
					Data escursione: dal 
					<h:outputText value="#{personalizationBean.reservation.excursionAvailability.fromDate}" >
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText> al 
					<h:outputText value="#{personalizationBean.reservation.excursionAvailability.toDate}" >
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText>
					Costo a persona: #{personalizationBean.reservation.excursionAvailability.excursionPrice} euro
				</td>
				<td>#{personalizationBean.reservation.excursionPrice} euro</td>
			</tr>
			<tr>
				<td>Volo di andata:</td>
				<td>
					Compagnia aerea #{personalizationBean.reservation.flight1.company}<br/>
					Partenza dall'aeroporto #{personalizationBean.reservation.flight1.airport1.name} di #{personalizationBean.reservation.flight1.airport1.location.name} in data
					<h:outputText value="#{personalizationBean.reservation.flight1.departureTime}" >
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText><br />
					Arrivo all'aeroporto #{personalizationBean.reservation.flight1.airport2.name} di #{personalizationBean.reservation.flight1.airport2.location.name} in data
					<h:outputText value="#{personalizationBean.reservation.flight1.landingTime}" >
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText><br />
					Costo a passeggero: #{personalizationBean.reservation.flight1.price} euro
				</td>
				<td>#{personalizationBean.reservation.flight1Price} euro</td>
			</tr>
			<tr>
				<td>Volo di ritorno:</td>
				<td>
					Compagnia aerea #{personalizationBean.reservation.flight2.company}<br/>
					Partenza dall'aeroporto #{personalizationBean.reservation.flight2.airport1.name} di #{personalizationBean.reservation.flight1.airport2.location.name} in data
					<h:outputText value="#{personalizationBean.reservation.flight1.departureTime}" >
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText><br />
					Arrivo all'aeroporto #{personalizationBean.reservation.flight2.airport2.name} di #{personalizationBean.reservation.flight2.airport2.location.name} in data
					<h:outputText value="#{personalizationBean.reservation.flight2.landingTime}" >
						<f:convertDateTime pattern="dd.MM.yyyy HH:mm" />
					</h:outputText><br />
					Costo a passeggero: #{personalizationBean.reservation.flight2.price} euro
				</td>
				<td>#{personalizationBean.reservation.flight2Price} euro</td>
			</tr>
		</table>
		<p:separator />
		<center>
			Il costo totale della prenotazione ammonta a #{personalizationBean.reservation.totalPrice} euro.
			<br /><br />
			<p:button outcome="personalizePackage" value="Indietro" />
			<p:commandButton action="#{personalizationBean.confirmReservation}" value="Conferma prenotazione" />
		</center>
		<br />
		<p:messages showDetail="true" autoUpdate="true" closable="true" />
		<p:separator />
		<center>
			Se vuoi puoi condividere questo pacchetto viaggio con chi vuoi! Copia e incolla il codice sottostante ed invialo a qualche tuo amico:<br />
			<h:outputText value="#{personalizationBean.pack.id}w#{personalizationBean.reservation.hotelAvailability.id}w#{personalizationBean.reservation.excursionAvailability.id}w#{personalizationBean.reservation.flight1.id}w#{personalizationBean.reservation.flight2.id}" />
		</center>
	</p:fieldset>
	</h:form>
	
	</ui:define>
</ui:composition>
</html>